app.controller("myCtrl",function($scope,$state){
    //用户数据
    var userInfo = JSON.parse(localStorage.getItem("UserInfo"));
    angular.element(document).ready(function () {
        //数据绑定

        //用户名
        $scope.username = userInfo.userName;
        //头像
        $scope.userHeader = userInfo.userHeader;
        //组织
        if(userInfo.orgSubName){
            $scope.orgSubName = "/"+userInfo.orgSubName;
        }
        //职务
        if(userInfo.positionName){
            $scope.positionName = "/"+userInfo.positionName;
        }

        //平台
        $scope.orgName = userInfo.orgName;
    });

    //用户在支部排名
    $scope.openUserDeptRanking = function(){
        $state.go("home.userDeptRanking");
    }
    //支部排名
    $scope.openDeptRanking = function(){
        $state.go("home.deptRanking");
    }
    //整体排名
    $scope.openRanking = function(){
        $state.go("home.ranking");
    }
    //学分查询
    $scope.openIntegralSearch = function(){
        $state.go("home.integralSearch");
    }
    //历史成绩
    $scope.openGradeSearch = function(){
        $state.go("home.gradeSearch");
    }
    //我的书籍
    $scope.openHistoryBook = function(){
        $state.go("home.historyBook");
    }
    //笔记
    $scope.openNoteList = function(){
        $state.go("home.noteList");
    }
    //设置
    $scope.openSetting = function(){
        $state.go("home.mySetting");
    }
});